package edu.neusoft.yiqibike.common.injection;

import org.apache.shiro.SecurityUtils;
import org.springframework.core.MethodParameter;
import org.springframework.web.bind.support.WebDataBinderFactory;
import org.springframework.web.context.request.NativeWebRequest;
import org.springframework.web.method.support.ModelAndViewContainer;

/**
 * User：lyc
 * Date：2017-12-12
 * Time：13:59
 * Description：@LoginUser注解依赖注入
 */
public class LoginUserInjection extends BaseLoginUserInjection {
    //获取当前登录的管理员信息
    @Override
    public Object resolveArgument(MethodParameter methodParameter, ModelAndViewContainer modelAndViewContainer, NativeWebRequest nativeWebRequest, WebDataBinderFactory webDataBinderFactory) throws Exception {
        return SecurityUtils.getSubject().getPrincipal();
    }
}
